import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/auth/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/auth/me',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/auth/logout',
    method: 'post'
  })
}

export function SystemUserFetch(query){
  return request({
    url: '/usersManage/user',
    method: 'get',
    params : query
  })
}

export function SystemUserUpdate(data){
  return request({
    url: '/usersManage/user/'+data.id,
    method: 'put',
    data
  })
}

export function SystemUserAdd(data){
  return request({
    url: '/usersManage/user',
    method: 'post',
    data
  })
}
export function SystemUserDelete(id){
  return request({
    url: '/usersManage/user/'+id,
    method: 'delete',
  })
}

export function MiniUserFetch(query){
  return request({
    url: '/usersManage/user',
    method: 'get',
    params : query
  })
}

